﻿Imports System.Collections.Generic
Imports System.Data
Imports System.Data.SqlClient


Public Class TDGDigitoVerificador


    Private Shared m_Instance As TDGDigitoVerificador = Nothing



    Public Function EsValido(conn As SqlConnection) As Boolean
        Dim command As New SqlCommand
        Dim dr As SqlDataReader
        Dim outParam As SqlParameter


        command.Connection = conn
        command.CommandType = CommandType.StoredProcedure

        command.CommandText = "dbo.getDVEsValido"

        outParam = command.Parameters.Add("@EsValido", SqlDbType.Bit)
        outParam.Direction = ParameterDirection.Output

        command.ExecuteNonQuery()

        
        Return outParam.Value

    End Function

    Public Shared ReadOnly Property Instance()
        Get
            If (m_Instance Is Nothing) Then
                m_Instance = New TDGDigitoVerificador()
            End If

            Return m_Instance
        End Get
    End Property

    Private Sub New()

    End Sub

End Class
